package com.ruoyi.tranShort.controller;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.tranShort.domain.ShortBaseStationDervice;
import com.ruoyi.tranShort.service.IShortBaseStationDerviceService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 基站管理Controller
 * 
 * @author ruoyi
 * @date 2021-08-09
 */
@RestController
@RequestMapping("/tranShort/baseStationDervice")
public class ShortBaseStationDerviceController extends BaseController
{
    @Autowired
    private IShortBaseStationDerviceService shortBaseStationDerviceService;

    /**
     * 查询基站管理列表
     */
    @PreAuthorize("@ss.hasPermi('tranShort:baseStationDervice:list')")
    @GetMapping("/list")
    public TableDataInfo list(ShortBaseStationDervice shortBaseStationDervice)
    {
        startPage();
        List<ShortBaseStationDervice> list = shortBaseStationDerviceService.selectShortBaseStationDerviceList(shortBaseStationDervice);
        return getDataTable(list);
    }

    /**
     * 导出基站管理列表
     */
    @PreAuthorize("@ss.hasPermi('tranShort:baseStationDervice:export')")
    @Log(title = "基站管理", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ShortBaseStationDervice shortBaseStationDervice)
    {
        List<ShortBaseStationDervice> list = shortBaseStationDerviceService.selectShortBaseStationDerviceList(shortBaseStationDervice);
        ExcelUtil<ShortBaseStationDervice> util = new ExcelUtil<ShortBaseStationDervice>(ShortBaseStationDervice.class);
        return util.exportExcel(list, "基站管理数据");
    }

    /**
     * 获取基站管理详细信息
     */
    @PreAuthorize("@ss.hasPermi('tranShort:baseStationDervice:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(shortBaseStationDerviceService.selectShortBaseStationDerviceById(id));
    }

    /**
     * 新增基站管理
     */
    @PreAuthorize("@ss.hasPermi('tranShort:baseStationDervice:add')")
    @Log(title = "基站管理", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ShortBaseStationDervice shortBaseStationDervice)
    {
        return toAjax(shortBaseStationDerviceService.insertShortBaseStationDervice(shortBaseStationDervice));
    }

    /**
     * 修改基站管理
     */
    @PreAuthorize("@ss.hasPermi('tranShort:baseStationDervice:edit')")
    @Log(title = "基站管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ShortBaseStationDervice shortBaseStationDervice)
    {
        return toAjax(shortBaseStationDerviceService.updateShortBaseStationDervice(shortBaseStationDervice));
    }

    /**
     * 删除基站管理
     */
    @PreAuthorize("@ss.hasPermi('tranShort:baseStationDervice:remove')")
    @Log(title = "基站管理", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(shortBaseStationDerviceService.deleteShortBaseStationDerviceByIds(ids));
    }
}
